package com.example.demo.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.bean.CmsRoom;
import com.example.demo.common.Response;
import com.example.demo.service.CmsRoomService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api(tags = "房间管理服务")
@RestController
@RequestMapping("/room")
public class CmsRoomController {
	
	@Autowired
	CmsRoomService roomService;
	
	@ApiOperation(value = "展示所有房间类型")
	@GetMapping("/All")
	public Response<List<CmsRoom>> findAll(){
		List<CmsRoom> all = roomService.findAll();
		return Response.ok(all);
	}
	
	@ApiOperation(value = "按类型查找房间")
	@GetMapping("/select")
	public Response<CmsRoom> selectById(String id){
		CmsRoom data = roomService.selectById(id);
		return Response.ok(data);
	}
	
}
